Component({
  /**
   * 组件的属性列表
   */
  properties: {
    swiperData: Array,
    bgUrl:String,
    imgHost:String
  },

  /**
   * 组件的初始数据
   */

  data: {
    color:''
  },
  observers: {
    'swiperData': function (swiper) {
      const color = swiper && swiper[0] && swiper[0].color;
      this.setData({
        color: color
      })
    }
  },
  /**
   * 组件的方法列表
   */
  methods: {
    swiperChangeHandler(event){
      let currentColor = this.data.swiperData[event.detail.current].color;
      this.setData({
        color:currentColor
      })
    },
    toCoursepages() {
      wx.navigateTo({
        url: "/pages/index/course-list/index"
      })
    }
  }
})